using System;
using System.ComponentModel;
using System.Security.Principal;
using System.Web;
using System.Web.SessionState;

namespace WebMonitor.Http {
    public interface IHttpApplication : IHttpAsyncHandler, IComponent {
        // Events
        event EventHandler AcquireRequestState;
        event EventHandler AuthenticateRequest;
        event EventHandler AuthorizeRequest;
        event EventHandler BeginRequest;
        event EventHandler EndRequest;
        event EventHandler Error;
        event EventHandler PostRequestHandlerExecute;
        event EventHandler PreRequestHandlerExecute;
        event EventHandler PreSendRequestContent;
        event EventHandler PreSendRequestHeaders;
        event EventHandler ReleaseRequestState;
        event EventHandler ResolveRequestCache;
        event EventHandler UpdateRequestCache;
        // Methods
        void AddOnAcquireRequestStateAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnAuthenticateRequestAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnAuthorizeRequestAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnBeginRequestAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnEndRequestAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnPostRequestHandlerExecuteAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnPreRequestHandlerExecuteAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnReleaseRequestStateAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnResolveRequestCacheAsync(BeginEventHandler bh, EndEventHandler eh);
        void AddOnUpdateRequestCacheAsync(BeginEventHandler bh, EndEventHandler eh);
        void CompleteRequest();
        string GetVaryByCustomString(HttpContext context, string custom);
        void Init();
        // Properties
        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        IHttpApplicationState Application { get; }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
        IHttpContext Context { get; }

        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        HttpModuleCollection Modules { get; }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
        IHttpRequest Request { get; }

        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        IHttpResponse Response { get; }

        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        IHttpServerUtility Server { get; }

        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        IHttpSessionState Session { get; }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
        IPrincipal User { get; }
    }
}